#ifndef _DISK_H_
#define _DISK_H_

#include <string>

class Disk
{
public:
	bool Open(const char *arg0);
	bool AutoSetup();
	void Close();

	bool FExists(const char *name);

	int CStrOpen(const char* name, char **textp);
	int CStrOpen(const std::string & name, char **textp)
	{
		return CStrOpen(name.c_str(), textp);
	}
	void CStrClose(char *text);

	int TextOpen(const char *name, std::string & text);
	int TextOpen(const std::string & name, std::string & text)
	{
		return TextOpen(name.c_str(), text);
	}
	int TextSave(const char *name, const std::string & text);
	int TextSave(const std::string & name, const std::string & text)
	{
		return TextSave(name.c_str(), text);
	}

	void SaveToBase();
	void SaveToUser();

private:
	void Error(const char *func, const char *name);
	void Error(const char *func, const std::string & name)
	{
		Error(func, name.c_str());
	}
};

extern Disk Dsk;

#endif
